﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Scrollbar</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>

    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <script id="scriptInit" type="text/javascript">
    /*code_begin*/
    $(document).ready(function () {
        var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"), { sheetCount: 1 });
        initSpread(spread);
    });

    function initSpread(spread) {
        //Binding settings
        $("#showHorizontalScrollbar").change(function () {
            spread.showHorizontalScrollbar($(this).prop("checked"));
        });

        $("#showVerticalScrollbar").change(function () {
            spread.showVerticalScrollbar($(this).prop("checked"));
        });
        $("#scrollbarMaxAlign").change(function () {
            spread.scrollbarMaxAlign($(this).prop("checked"));
        });

        $("#scrollbarShowMax").change(function () {
            spread.scrollbarShowMax($(this).prop("checked"));
        });

        $("#optShowScrollTip").change(function () {
            var result = parseInt($(this).val());
            spread.showScrollTip(result);
        });

        $("#scrollIgnoreHidden").change(function () {
            spread.scrollIgnoreHidden($(this).prop("checked"));
        });

        var sheet = spread.getActiveSheet();
        sheet.isPaintSuspended(true);
        sheet.setRowCount(40);
        sheet.setColumnCount(20);
        sheet.colRangeGroup.group(5, 5);
        sheet.rowRangeGroup.group(5, 5);
        sheet.setValue(1, 4, 1);
        sheet.setValue(2, 4, 2);
        sheet.setValue(3, 4, 3);
        sheet.setValue(4, 4, 4);
        sheet.setValue(5, 4, 5);
        sheet.setValue(6, 4, 6);
        sheet.getColumn(2).visible(false);
        sheet.setColumnWidth(7, 0);
        sheet.setRowHeight(8, 0);
        sheet.getRow(15).visible(false);
        var hlf = new GcSpread.Sheets.HideRowFilter(new GcSpread.Sheets.Range(1, 4, 6, 1));
        sheet.rowFilter(hlf);
        sheet.rowFilter().addNumberFilter(4, GcSpread.Sheets.GeneralCompareType.GreaterThan, 2);
        sheet.rowFilter().filter();
        sheet.isPaintSuspended(false);
    };
    /*code_end*/
    </script>

</head>
<body class="demo-single">
    <div class="sample-turtorial">
        <div id="ss" style="width:100%; height:450px;border: 1px solid gray;"></div>
        <div class="demo-options">
            <div class="option-row">
                <label>ShowScrollTip:</label>
                <select id="optShowScrollTip" >
                    <option value="0" selected="selected">None</option>
                    <option value="1">Horizontal</option>
                    <option value="2">Vertical</option>
                    <option value="3">Both</option>
                </select>
            </div>
            <div class="option-row">
                <input type="checkbox" id="showHorizontalScrollbar" checked="checked" />
                <label for="showHorizontalScrollbar">Show Horizontal Scrollbar</label>
            </div>
            <div class="option-row">
                <input type="checkbox" id="showVerticalScrollbar" checked="checked" />
                <label for="showVerticalScrollbar">Show Vertical Scrollbar</label>
            </div>
            <div class="option-row">
                <input type="checkbox" id="scrollbarMaxAlign"> 
                <label for="scrollbarMaxAlign">Scrollbar Max Align</label> 
             </div>
            <div class="option-row">
                <input type="checkbox" id="scrollbarShowMax" checked="checked"> 
                <label for="scrollbarShowMax">Scrollbar Show Max</label> 
            </div>
            <br />
            <div class="option-row">
                <input type="checkbox" id="scrollIgnoreHidden">
                <label for="scrollIgnoreHidden">Scroll Ignore Hidden</label> 
            </div>
        </div>
    </div>
</body>
</html>
